<!-- <table id="test" class="table table-striped sorter"> -->
<table id="test" class="table table-striped">
	<thead>
		<tr>
			<th>Titre</th>
			<th>Modif</th>
			<th>Suppr</th>
			<th>Date ajout</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($this->rows as $song) { ?>
		<tr>
			<td><?php echo $song->title ?></td>
			<td class="span1"><a href="<?php echo $this->url('song', array('action'=>'edit')) ?>?id=<?php echo $song->id ?>"><i
					class="icon-edit"></i> </a></td>
			<td class="span1"><i id="<?php echo $song->id ?>" class="icon-remove"></i></td>
			<td class="span2"><?php echo Admin\Model\Util::formateDate($song->date_create); ?></td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<?php echo $this->paginationControl($this->rows,
                                    'Sliding',
                                    'layout/paginator', array('route' => 'application/paginator')); ?>

<script type="text/javascript">
$(document).ready(function(){
	$('.icon-remove').click(function(){
		$('input#id').val($(this).attr('id'));
		$('#myModal').modal('show');
	});
	
	$('#submit').click(function(){
		$('#form').submit();
	});

});
</script>

<div class="modal" id="myModal" tabindex="-1" role="dialog"	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true">×</button>
		<h3 id="myModalLabel">Voulez-vous vraiment supprimer cet élement ?</h3>
	</div>
	<div class="modal-body">
		<p>L'opération effacera l'élément de la BDD et sera irreversible.</p>
		<form method="post" id="form" action="<?php echo $this->url('song', array('action'=>'delete')) ?>">
			<input type="hidden" name="id" value="" id="id"/>
		</form>
	</div>
	<div class="modal-footer">
		<button class="btn" id="submit">Oui</button>
		<button class="btn btn-primary" data-dismiss="modal"
			aria-hidden="true">Non</button>
	</div>
</div>
